package cn.iocoder.yudao.module.promotion.dal.mysql.paymentterm;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.promotion.dal.dataobject.paymentterm.PaymentTermDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.promotion.controller.admin.paymentterm.vo.*;

/**
 * 收款方式 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PaymentTermMapper extends BaseMapperX<PaymentTermDO> {

    default PageResult<PaymentTermDO> selectPage(PaymentTermPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PaymentTermDO>()
                .likeIfPresent(PaymentTermDO::getZfbName, reqVO.getZfbName())
                .likeIfPresent(PaymentTermDO::getZfbAccount, reqVO.getZfbAccount())
                .likeIfPresent(PaymentTermDO::getBankAccount, reqVO.getBankAccount())
                .likeIfPresent(PaymentTermDO::getBankName, reqVO.getBankName())
                .likeIfPresent(PaymentTermDO::getBankCode, reqVO.getBankCode())
                .orderByDesc(PaymentTermDO::getId));
    }

}